package com.xuecheng.content.checkutils;

import java.util.function.Supplier;

public class CheckInsertResultUtil {
    public static void check(int result, Supplier<RuntimeException> exceptionSupplier) {
        if (result == 0) {
            throw exceptionSupplier.get();
        }
    }


    public static <T> T checkExist(T obj, Supplier<RuntimeException> exceptionSupplier) {
        if (obj == null) {
            throw exceptionSupplier.get();
        }
        return obj;
    }
}
